package com.woniuxy.background.service.impl;

import com.woniuxy.background.dao.LogMapper;
import com.woniuxy.background.pojo.Log;
import com.woniuxy.background.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    @Override
    public void saveLog(Log log) {
        logMapper.insertSelective(log);
    }

    @Override
    public int deleteLog(Date time) {
        return logMapper.deleteLogByDate(time);
    }

    @Override
    public List<Log> queryLogsByPage(Integer currentPage, Integer pageSize, String username) {
        return logMapper.queryLogsByPage(currentPage,pageSize,username);
    }

    @Override
    public void batchDeleteLog(List<Integer> list) {
        logMapper.batchDeleteLog(list);
    }

    @Override
    public int deleteByPrimaryKey(Integer logId) {
        return logMapper.deleteByPrimaryKey(logId);
    }
}
